
<script>
	//var getBaseUrl = require("/common/env.config").getBaseUrl;
	import { appInfo, setDeviceID, setClientType } from './common/appinfo'
	import { getState } from 'common/util';
	var reqeust = require('common/request.js').request;

	export default {
		
		onLaunch: function () {

			//getApp().globalData.socketConnectionFail = false;
			console.log('App Launch');
			//#ifdef APP-PLUS
			/* 5+环境锁定屏幕方向 */
			plus.screen.lockOrientation('portrait-primary'); //锁定
			setClientType(plus.os.name)
			setDeviceID(plus.device.uuid +plus.device.imsi); 
			//#endif
			//#ifdef MP-WEIXIN
			//#endif
			this.$store.dispatch("refreshTokenAction");
			this.$store.dispatch("connect", {userId:this.$store.state.user.userId})
		},
		onShow: function () {
			var that = this;
			//#ifdef APP-PLUS
// 			plus.geolocation.watchPosition(function(res) {
// 				that.$store.dispatch("recordGeoPoint", {
// 					latitude:  res.coords.latitude,
// 					longitude:  res.coords.longitude,
// 					altitude:  res.coords.altitude,
// 					}).then(response => {})
// 			},function(e) {
// 				console.log('GeoLocation error code: -'+ e.code+ '; message - ' + e.message)
// 			})
			//#endif
		},
		onHide: function () {
			console.log('App Hide')
		},
	}
</script>

<style>
		/* uni.css - 通用组件、模板样式库，可以当作一套ui库应用 */
		@import "./common/uni.css";
		
		/* 以下样式用于 hello uni-app 演示所需 */
		page {
			background-color:#F4F5F6;
			height: 100%;
			font-size:28upx;
			line-height: 1.8;
		}
		.uni-header-logo{
			padding:30upx;
			text-align:center;
			margin-top:10upx;
		}
		.uni-header-logo image{
			width: 140upx;
			height: 140upx;
		}
		.uni-hello-text{
			color:#7A7E83;
		}
		.uni-hello-addfile{
			text-align:center; 
			line-height:300upx;
			background:#FFF;
			padding:50upx;
			margin-top:10px;
			font-size:38upx;
			color:#808080;
		}
</style>
